package com.polaris.live.viewmodel

import androidx.lifecycle.MutableLiveData
import com.polaris.live.common.mvvm.viewmodel.BaseViewModel
import com.polaris.live.common.network.request
import com.polaris.live.common.network.state.ResultState
import com.polaris.live.im.sfs.bean.live.ext.UserBasicVo
import com.polaris.live.net.homeService
import com.polaris.live.net.userService
import com.polaris.live.resp.back_resp.DisplayUserBean

/**
 * 用户搜索的viewModel
 *
 * @author Created by 半仙 on 2024/9/10/010 15:59
 */
class SearchUserViewModel : BaseViewModel() {

    val searchRoomLiveData = MutableLiveData<ResultState<List<DisplayUserBean>>>()
    fun searchRoom(userNumber: Long) {
        request({ homeService.searchRoom(userNumber) }, searchRoomLiveData)
    }

    val searchOtherLiveData = MutableLiveData<ResultState<List<UserBasicVo>>>()
    fun searchOtherUser(userNumber: Long) {
        request({ userService.getInfoOtherAll(userNumber) }, searchOtherLiveData)
    }
}